<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:if test="${page.totalPage > 1 }">
<div class="text-center">
	<ul class="pagination pagination-sm">
		<li><a href="javascript:_gotoPage(1);" title="首页">首页</a></li>
		<li <c:if test="${1 == page.pageNo}">class="disabled" </c:if>><a href="javascript:_gotoPage(${page.prePage});" title="显示上${page.pageSize}条记录">&laquo; 上一页</a></li>
		<li><a href="javascript:void(0);">  ${page.pageNo}/${page.totalPage}</a></li>
		<li <c:if test="${page.totalPage == page.pageNo}">class="disabled" </c:if>><a href="javascript:_gotoPage(${page.nextPage});" title="显示下${page.pageSize}条记录">下一页  &raquo;</a></li>
		<li><a href="javascript:_gotoPage(${page.totalPage});" title="末页">末页</a></li>
		<li><a href="javascript:void(0)"  
			data-trigger="click" 
			data-placement="top"
			data-toggle="popover" 
			title="分页信息" 
			data-content="本查询中共有 ${page.totalCount} 条记录，每页${page.pageSize}条。" 
			<span class="fa fa-info-circle"></span>
			</a>
		</li>
	</ul>
</div>

<input type="hidden" id="pageNo" name="pageNo" value="${page.pageNo}" />
<input type="hidden" id="pageSize" name="pageSize" value="${page.pageSize}" />
<input type="hidden" id="pageTotalCount" name="pageTotalCount" value="${page.totalCount}" />
<script type="text/javascript">
$(function () {
	  $('[data-toggle="popover"]').popover()
})
function go(){
	if(!isNaN($("#goNumber").val())){
		if($("#goNumber").val()>0){
			_gotoPage($("#goNumber").val());
		}
	}
}
function _gotoPage(pageNo) {
	try{
		var formPageNo = $("#pageNo")
		var tableForm = $(formPageNo).closest("form");
		if(pageNo){
			$("#pageNo").val(pageNo);
		}else{
			$("#pageNo").val(1);
		}
		tableForm.onsubmit=null;
		tableForm.submit();
	} catch(e) {
		alert('_gotoPage(pageNo)方法出错');
	}
}

$(function(){
	var formId = '${param.formId}';
	$('#'+formId).ajaxForm({ 
        type: "post",
        dataType:"html",
        beforeSubmit: function(){
        },
        clearForm: false,
        resetForm: false,
        success: function(content){
        	$('#'+formId).parent().html(content);
        },
        error:function(resp){
        	ui.msg.error('请求发送失败', 0);
        }
    }); 
})
</script>
</c:if>